<template>
  <div>
     <ul>
       <li v-for="(item,index) in list" :key="item.order">{{item.name}}</li>
     </ul>
  </div>
</template>

<script>
//引入axios
import axios from 'axios';
export default {
  name: '',
  data(){
     return {
       list:[]
     }
  },
  //如果请求书写在mounted里面，请求能发几次?
  mounted(){
    //发请求:
    //axios可以对象写法 axios.xxx
    //axios可以函数写法 axios({url:'xxx',method:'xxx'});
    axios.get('/api/students').then((res)=>{
         this.list = res.data.workPlace;
    })
  }
}
</script>

<style scoped>

</style>

